$package('itsm.system');

itsm.system.orderMain=function(){
	this.opt='';
	return {
		//列表
		orderMainGrid:function(){
			var params = $.extend({},jqGridParams, {
				url:'orders!findOrderPager.action',
				caption:'在线支付记录',
				colNames:['ID','订单号','会员账号','充值金额','支付状态','提交时间','描述'],
			 	colModel:[
			 	          {name:'id',align:'center'},
			 	          {name:'orderNo',align:'left'},
			 	          {name:'loginName',align:'left'},
			 	          {name:'payMoeny',align:'left'},
			 	          {name:'orderStatus',align:'center'},
			 	          {name:'createTime',align:'left'},
			 	          {name:'odesc',align:'left'}
			 	],
				jsonReader: $.extend(jqGridJsonReader, {id: "id"}),
				sortname:'id',
				pager:'#orderMainPager'
				});
				$("#orderMainGrid").jqGrid(params);
				$("#orderMainGrid").navGrid('#orderMainPager',navGridParams);
				//列表操作项
				$("#t_orderMainGrid").css(jqGridTopStyles);
				$("#t_orderMainGrid").html($('#orderMainGridToolbar').html());
				
				//自适应宽度
				setGridWidth("#orderMainGrid","regCenter",10);
			
		},
		
		//删除
		deleteOrders:function(){
			checkBeforeDeleteGrid('#orderMainGrid',function(rowIds){
				var pp = $.param({'ids':rowIds},true);
				$.post("orders!deteleOrder.action", pp, function(){
					$('#orderMainGrid').trigger('reloadGrid');
					msgShow('删除成功!','show');
				}, "json");
			});
		},
		
		init:function(){
			itsm.system.orderMain.orderMainGrid();
		}
	}
	
}();

$(function(){
	itsm.system.orderMain.init();
});